/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package server.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author USER
 */
@Entity
@Table(name = "CreatesContest", catalog = "WebPhotoShare", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "CreatesContest.findAll", query = "SELECT c FROM CreatesContest c"),
    @NamedQuery(name = "CreatesContest.findByIdContest", query = "SELECT c FROM CreatesContest c WHERE c.idContest = :idContest"),
    @NamedQuery(name = "CreatesContest.findByNameContest", query = "SELECT c FROM CreatesContest c WHERE c.nameContest = :nameContest"),
    @NamedQuery(name = "CreatesContest.findByContentContest", query = "SELECT c FROM CreatesContest c WHERE c.contentContest = :contentContest"),
    @NamedQuery(name = "CreatesContest.findByReqContest", query = "SELECT c FROM CreatesContest c WHERE c.reqContest = :reqContest"),
    @NamedQuery(name = "CreatesContest.findByFromDate", query = "SELECT c FROM CreatesContest c WHERE c.fromDate = :fromDate"),
    @NamedQuery(name = "CreatesContest.findByToDate", query = "SELECT c FROM CreatesContest c WHERE c.toDate = :toDate"),
    @NamedQuery(name = "CreatesContest.findByStatus", query = "SELECT c FROM CreatesContest c WHERE c.status = :status")})
public class CreatesContest implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "IdContest", nullable = false)
    private Integer idContest;
    @Basic(optional = false)
    @Column(name = "NameContest", nullable = false, length = 15)
    private String nameContest;
    @Basic(optional = false)
    @Column(name = "ContentContest", nullable = false, length = 500)
    private String contentContest;
    @Basic(optional = false)
    @Column(name = "ReqContest", nullable = false, length = 200)
    private String reqContest;
    @Basic(optional = false)
    @Column(name = "FromDate", nullable = false, length = 50)
    private String fromDate;
    @Basic(optional = false)
    @Column(name = "ToDate", nullable = false, length = 50)
    private String toDate;
    @Basic(optional = false)
    @Column(name = "Status", nullable = false)
    private boolean status;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "createsContest")
    private Collection<JoinContest> joinContestCollection;

    public CreatesContest() {
    }

    public CreatesContest(Integer idContest) {
        this.idContest = idContest;
    }

    public CreatesContest(Integer idContest, String nameContest, String contentContest, String reqContest, String fromDate, String toDate, boolean status) {
        this.idContest = idContest;
        this.nameContest = nameContest;
        this.contentContest = contentContest;
        this.reqContest = reqContest;
        this.fromDate = fromDate;
        this.toDate = toDate;
        this.status = status;
    }

    public Integer getIdContest() {
        return idContest;
    }

    public void setIdContest(Integer idContest) {
        this.idContest = idContest;
    }

    public String getNameContest() {
        return nameContest;
    }

    public void setNameContest(String nameContest) {
        this.nameContest = nameContest;
    }

    public String getContentContest() {
        return contentContest;
    }

    public void setContentContest(String contentContest) {
        this.contentContest = contentContest;
    }

    public String getReqContest() {
        return reqContest;
    }

    public void setReqContest(String reqContest) {
        this.reqContest = reqContest;
    }

    public String getFromDate() {
        return fromDate;
    }

    public void setFromDate(String fromDate) {
        this.fromDate = fromDate;
    }

    public String getToDate() {
        return toDate;
    }

    public void setToDate(String toDate) {
        this.toDate = toDate;
    }

    public boolean getStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public Collection<JoinContest> getJoinContestCollection() {
        return joinContestCollection;
    }

    public void setJoinContestCollection(Collection<JoinContest> joinContestCollection) {
        this.joinContestCollection = joinContestCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idContest != null ? idContest.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CreatesContest)) {
            return false;
        }
        CreatesContest other = (CreatesContest) object;
        if ((this.idContest == null && other.idContest != null) || (this.idContest != null && !this.idContest.equals(other.idContest))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "server.entity.CreatesContest[idContest=" + idContest + "]";
    }

}
